package com.persistence;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;



@Entity(name ="DEPENDENT")
@Table(name="dependent")
public class Dependent implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@TableGenerator(name = "DEPENTENT_SEQ", table = "tbsequence", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT", pkColumnValue = "DEPENDET_IDX", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "DEPENDET_SEQ")
	@Column(name="ID")
	private Integer id;

	@Column(name="BIRTHDATE")
	@Temporal (value = TemporalType.TIMESTAMP) 
	private Date birthdate;

	@Column(name="DEPENDENT_TYPE")
	private short dependentType;

	@Column(name="FIRSTNAME")
	private String firstname;

	@Column(name="GENDER")
	private short gender;

	@Column(name="LASTNAME")
	private String lastname;

	
    @ManyToOne
	@JoinColumn(name="MEMBERSHIPID")
	private Membership membership;

    public Dependent() {
    }

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Date getBirthdate() {
		return this.birthdate;
	}

	public void setBirthdate(Date birthdate) {
		this.birthdate = birthdate;
	}

	public short getDependentType() {
		return this.dependentType;
	}

	public void setDependentType(short dependentType) {
		this.dependentType = dependentType;
	}

	public String getFirstname() {
		return this.firstname;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	public short getGender() {
		return this.gender;
	}

	public void setGender(short gender) {
		this.gender = gender;
	}

	public String getLastname() {
		return this.lastname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	public Membership getMembership() {
		return this.membership;
	}

	public void setMembership(Membership membership) {
		this.membership = membership;
	}
	
}